package Models
{
	import flash.net.LocalConnection;
	
	import mx.controls.Alert;

	public class Model
	{
		[Bindable]
		public var externalText : String;
		
		private var conn1to2 : LocalConnection = new LocalConnection();
		private var conn2to1 : LocalConnection = new LocalConnection();
		
		
		public function Model()
		{
			conn1to2.allowDomain("*");
			conn1to2.client = this;
			conn1to2.connect("From1To2Connection");
		}
		
		public function SetExternalText (s : String) : void
		{
			externalText = s;
		}
		
		public function Send(s : String) : void
		{
			conn2to1.send("From2To1Connection", "SetReceivedText", s);
		}
	}
}